# Contributor: Petr Hodina <phodina@protonmail.com>
# Maintainer: Petr Hodina <phodina@protonmail.com>
pkgname=dovi-tool
pkgver=2.0.3
pkgrel=0
pkgdesc="Library to read and write Dolby Vision metadata"
url="https://github.com/quietvoid/dovi_tool"
# arm: fails tests
arch="all !armhf !armv7"
license="MIT"
makedepends="cargo cargo-auditable fontconfig-dev"
checkdepends="font-opensans"
source="$pkgname-$pkgver.tar.gz::https://github.com/quietvoid/dovi_tool/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/dovi_tool-$pkgver"
options="net" # cargo fetch

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen --release
}

package() {
	install -Dm755 target/release/dovi_tool -t "$pkgdir"/usr/bin/
}

sha512sums="
49f42d85bfcb22ce35800f2aeebaea8ae3880227f4727c4ba92e6123bd460d2df58b7346473b9bde5a0d64db88e0c8280921800f58794d72625af1f6921aa219  dovi-tool-2.0.3.tar.gz
"
